package cn.webrx;

import java.util.Arrays;

public class Arr20 {
    public static void main(String[] args) {
        //一维数组
        int[] a1 = new int[]{1, 2, 3};
        System.out.println(Arrays.toString(a1));

        //二维数组
        int[][] a2 = {{1, 2, 3}, {10, 20, 30, 40, 50, 60}, {100, 200, 300}};
        System.out.println(Arrays.deepToString(a2));


        //遍历二维
        for(int[] a : a2){
            for(int b : a){
                System.out.print(b + "  ");
            }
            System.out.println();
        }


        //如果输出我们a2二维数组元素的100，应该如何写代码
        System.out.println(a2[2][0]);

        //三维数组
        int[][][] a3 = {
                {
                    {1,2,3},
                    {4,5,6},
                    {7,8,9}
                },
                    {
                        {10},
                        {20},
                        {30}
                    },
                {
                    {
                        50,
                        1000
                    }
                }
        };

        //Arrays.deepTostring()
        System.out.println(Arrays.deepToString(a3));
        //输出1000怎么写
        System.out.println(a3[2][0][1]);


    }
}
